package io.shallwe._admin.basedata.hangerframe;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
import com.jfinal.validate.Validator;

/**
 * 挂框号、电泳框号绑定
 * @author : 王小伟
 * @date : 2019-07-18 14:47:09
 */
public class HangerFrameValidator extends Validator {
    @Override
    protected void validate(Controller c) {
        setRet(Ret.fail());
        setShortCircuit(true);
        validateRequired("middle.hangerNo","msg","必须填写挂架信息");
        validateRequired("middle.frameNo","msg","必须填写电泳框信息");
    }

    @Override
    protected void handleError(Controller c) {
        c.renderJson(getRet());
    }
}
